package com.eaoa.uc.bustransfer.form;

import org.apache.commons.lang.StringUtils;

import com.eaoa.base.EABaseForm;
import com.eaoa.vo.bus.BusTransfer;
import com.eaoa.vo.bus.BusVehicle;
import com.stony.core.util.CoreUtils;

public class BusTransferForm extends EABaseForm{

	// primary key
	private String transferno;

	// fields
	private String billcode;
	private String billstatus;
	private String vehicleno;
	private String cost;
	
	public void setVO(BusTransfer vo){
		this.setTransferno(CoreUtils.formatString(vo.getTransferno()));
		this.setBillcode(vo.getBillcode());
		this.setBillstatus(vo.getBillstatus());
		if(vo.getBusVehicle()!=null){
			this.setVehicleno(CoreUtils.formatString(vo.getBusVehicle().getVehicleno()));
		}
		this.setCost(CoreUtils.formatString(vo.getCost()));
	}
	
	public BusTransfer getVO(){
		BusTransfer po = new BusTransfer();
		po.setTransferno(CoreUtils.parseLong(this.getTransferno()));
		po.setBillcode(this.getBillcode());
		po.setBillstatus(this.getBillstatus());
		if(StringUtils.isNotBlank(this.getVehicleno())){
			po.setBusVehicle(new BusVehicle(CoreUtils.parseLong(this.getVehicleno())));
		}
		po.setCost(CoreUtils.parseBigDecimal(this.getCost()));
		return po;
	}
	
	public String getTransferno() {
		return transferno;
	}
	public void setTransferno(String transferno) {
		this.transferno = transferno;
	}
	public String getBillcode() {
		return billcode;
	}
	public void setBillcode(String billcode) {
		this.billcode = billcode;
	}
	public String getBillstatus() {
		return billstatus;
	}
	public void setBillstatus(String billstatus) {
		this.billstatus = billstatus;
	}
	public String getVehicleno() {
		return vehicleno;
	}
	public void setVehicleno(String vehicleno) {
		this.vehicleno = vehicleno;
	}
	public String getCost() {
		return cost;
	}
	public void setCost(String cost) {
		this.cost = cost;
	}

	
	
}
